<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<head>
    <link rel="stylesheet" type="text/css" href="/css/style_member.css" />
    <title>会员注册-笔飞美术作品</title>
    	<%@include file="../common/js.jsp"%>
    <%@include file="../common/jspcommon.jsp"%>
	<%@include file="../common/css.jsp"%>

	<script type="text/javascript" src="js/jquery.validate.js"></script>
	<script type="text/javascript" src="js/base.js"></script>
</head>
<body>
<div id="box">
  <%@include file="../common/header.jsp"%>
    <div id="main_div">
         <div class="site_map"><a href="/member.htm">首页</a> 》个人资料</div>
        <div id="member_div_2">
            <table cellpadding="0" cellspacing="0" class="member_table">
                <tr>
                    <td class="td_1" valign="top">
                        <div class="left_nav">
                        <ul>
	                            <li><a href="/member.htm">控制面板</a></li>
	                            <li	class="cur"><a href="/memberInfo.htm">个人资料</a></li>
	                            <li	><a href="/mOrders.htm">我的订单</a></li>
	                            <li><a href="/mMade.htm">我的定制</a></li>
	                            <li ><a href="/mActivity.htm">我的活动</a></li>
	                            <li><a href="/mHas.htm">关注收藏欣赏</a></li>
	                            <li><a href="mComment.htm">评论管理</a></li>
	                            <li><a href="mPay.htm">支付保证金</a></li>
	                        </ul>
                        </div>
                    </td>
                    <td class="td_2" valign="top">
                        <table cellpadding="3" cellspacing="1" class="member_table2">
                            <tbody>
                               <tr class="td1">
                                    <td style="width:25%; height:50px;">
                                        <b><a href="/memberInfo.htm" >账户信息</a></b>
                                    </td>
                                    <td style="width:25%;">
                                        <b><a href="/mBank.htm" class="current">银行帐号</a></b>
                                    </td>
                                    <td style="width:25%;">
                                        <b><a href="/mHobby.htm">我的喜好</a></b>
                                    </td>
                                    <td>
                                        <b><a href="/mAddress.htm">收货地址</a></b>
                                    </td>
                                </tr>
                                <tr class="td2">
                                    <td colspan="4">
                                    <form id="bankForm"  method="post">
                                    
                                        <table cellpadding="10" cellspacing="0" class="member_table3">
                                       <c:forEach items="${bankList }" var="list">
                                        <tr>
		                                            <td colspan="2" class="td11">
		                                                <span class="fl">&nbsp; &nbsp; &nbsp;${list.bankName}   &nbsp; &nbsp; &nbsp; &nbsp;     ${list.accountName }　 &nbsp; &nbsp; &nbsp; &nbsp;             ${list.accountCode}</span>
		                                                <span class="fr"><a href="#" onclick="deleteBank('${list.id}')"><img src="../images/btn_del2.jpg" alt="" /></a>
		                                                                                                                          　<c:if test="${ list.isDefault}"><a href="#"><img src="../images/btn_mr.jpg" alt="" /></a></c:if></span>
		                                            </td>
                                        
                                        </tr>
                                           </c:forEach>
                                        <tr>
                                            <td colspan="2" class="td11">
                                                <span class="style5">添加新的银行账号</span>
                                                <span class="font3">银行账户添加后不能修改，如需修改请联系客服。添加的第一个账号为默认账号</span>
                                                <span class="style6 fr">* 为必填项</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width:110px; text-align:right;">*开户人姓名：</td>
                                            <td align="left"><input type="text" class="input1" name="accountName" id="accountName" /></td>
                                        </tr>
                                        <tr>
                                            <td style="text-align:right;">*账号卡号：</td>
                                            <td align="left"><input type="text" class="input1" name="accountCode" id="accountCode"/></td>
                                        </tr>
                                        <tr>
                                            <td style="text-align:right;">*银行名称：</td>
                                            <td align="left">
		                                        <select name="show_data" tabindex="10" id="bankName">
			                                        <option value="0">--请选择银行--</option>
			                                        <option value="1">中国银行</option>
			                                        <option value="2">中国建设银行</option>
			                                        <option value="3">中国农业银行</option>
			                                        <option value="4">中国工商银行</option>
		                                        </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align:right;">*开户人所在城市：</td>
                                            <td align="left">
		                                        <select name="show_data" tabindex="10" id="province">
			                                        <option value="0">--请选择省--</option>
		                                        </select>
		                                        <select name="show_data" tabindex="10" id="city">
			                                        <option value="0">--请选择市--</option>
		                                        </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align:right;" valign="top">备注：</td>
                                            <td align="left">
                                                <textarea id="TextArea1" cols="20" rows="2" class="input3"></textarea></td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td align="right"><input type="submit" name="Submit" value="" class="submit btn_special btn_tjyhzh"/></td>
                                        </tr>
                                        </table>
                                       </form> 
                                        
                                        
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <%@include file="../common/footer.jsp" %>
    </div>
</div>
<script type="text/javascript">

initProvince('province', 'city');
/* $(function() {
	provinceChange('province', 'city','', '',  '${member.provinceCode }','${member.cityCode }','', '');
	provinceChange('provinceHome', 'cityHome', '', '','${memberDetail.birthProvinceCode }','${memberDetail.birthCityCode }','', '');
}); */
  function deleteBank(id){
	$.post("/deleteBankId.htm",  {
		id:id
	}, function(data){
		if(data=="success"){
			window.location.href="/mBank.htm"
		}
		if(data=="error"){
			alert("删除失败了。");
		}
	});
	
	}
$("#bankForm").validate(
		{
			rules : {
				accountName : {
					required : true,
					minlength : 2,
					maxlength : 20
				},
				accountCode : {
					required : true,
					minlength : 10,
					maxlength : 20
				}
			},
			messages : {
				accountName : {
					required : "请填写开户人姓名",
					minlength : "长度为2～20位",
					maxlength : "长度为2～20位"
				},
				accountCode:{
					required : "请填写确认账户卡号",
					minlength : "长度为10～20位",
					maxlength : "长度为10～20位"
				}
			},
			submitHandler : function() {
				$.post("saveBank.htm", {
					accountName : $("#accountName").val(),
					accountCode : $("#accountCode").val(),
					bankName : $("#bankName").find("option:selected").text(),
					provinceCode : $("#province").val(),
					cityCode : $("#city").val(),
					province : $("#province").find("option:selected").text(),
					city : $("#city").find("option:selected").text()
					}, function(data) {
						if (data == 'success') {
							alert("添加成功");
							window.location.href="/mBank.htm"
						} else{
							alert("添加失败");
						}
					});
			}
		});
</script>
</body>
</html>
